﻿// -----------------------------------------------------------------------
// <copyright file="Console.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Dhgms.TplHelper.Model.Provider.Job
{
    using System;
    using System.Collections.Generic;
    using System.Collections.Specialized;
    using System.Diagnostics;
    using System.Linq;
    using System.Text;

    using Dhgms.TplHelper.Model.Info.JobResult;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    internal class Console<TJobResultClass> : Base<TJobResultClass>
        where TJobResultClass : Base, new()
    {
        #region Public Methods and Operators

        /// <summary>
        /// Handles sending of error information to different mediums
        /// </summary>
        /// <param name="programGuid">
        /// Unique GUID used to identify program
        /// </param>
        /// <param name="programName">
        /// Friendly name of program
        /// </param>
        /// <param name="e">
        /// Exception message
        /// </param>
        public override void OnJobFailure(Guid programGuid, string programName, Exception e)
        {
            Console.WriteLine("The job failed:\r\n{0}", e);
        }

        /// <summary>
        /// Notify the provider of a job start
        /// </summary>
        /// <param name="jobGuid">
        /// Unique ID of the job
        /// </param>
        public override void OnJobStart(Guid jobGuid)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Handles sending out the result information
        /// </summary>
        /// <param name="jobGuid">
        /// Unique GUID used to identify program
        /// </param>
        /// <param name="jobName">
        /// Friendly name of program
        /// </param>
        /// <param name="taskResult">
        /// Run results of task
        /// </param>
        public override void OnJobSucess(Guid jobGuid, string jobName, TJobResultClass taskResult)
        {
        }

        /// <summary>
        /// Handles the sending of a task failure notification, if required
        /// </summary>
        /// <param name="taskGuid">
        /// The GUID relating to the task
        /// </param>
        /// <param name="e">
        /// Exception message
        /// </param>
        public override void OnTaskFailure(Guid taskGuid, Exception e)
        {
        }

        /// <summary>
        /// Handles the sending of a task start notification, if required
        /// </summary>
        /// <param name="taskGuid">
        /// The GUID relating to the task
        /// </param>
        public override void OnTaskStart(Guid taskGuid)
        {
        }

        /// <summary>
        /// Handles the sending of a task completion notification, if required
        /// </summary>
        /// <param name="taskGuid">
        /// The GUID relating to the task
        /// </param>
        public override void OnTaskSucess(Guid taskGuid)
        {
        }

        #endregion

        #region Methods

        /// <summary>
        /// On Initlize event
        /// </summary>
        /// <param name="name">
        /// </param>
        /// <param name="config">
        /// </param>
        protected override void OnInitialize(string name, NameValueCollection config)
        {
        }

        #endregion
    }
}
